a date field with a four digit year
If the Year value is greater than the windowing number, 19 is appended before the 2 digits (19xx). If the Year value is less than or equal to the windowing number, 20 is appended (20xx).
If the last two digits in the Year value are greater than the windowing number, the Year is preserved as found in the date field (19xx). If the last two digits in the Year value are less than or equal to the windowing number, the first two digits are changed to 20 (20xx). If the first two digits in the year field are 20, the Year is preserved as found in the date field (20xx).
The following examples are applicable to Basic and Crystal syntax:
Here the window value is greater than the year and so it will change it to 20XX.
DateTo2000(CDate(1993,12,12), 99)
Here the window value is less than the year and so it will not change the year.
DateTo2000(CDate(1993,12,12), 92)
This is an example of a date that will not be affected by the function.
DateTo2000(CDate(1899,12,12), 99)
This is an example of a date that will not be affected by the function.
DateTo2000(CDate(100,12,12), 99)
Some databases maintain the year of a date as a two digit field and so this will simulate that date field.
DateTo2000(CDate(98,12,12), 99)
DateTo2000(CDate(98,12,12), 97)
DateTo2000(CDate(9,12,12), 10)
Seagate Software IMG Holdings, Inc. http://www.seagatesoftware.com Support services: http://support.seagatesoftware.com |